package main

import (
	"fmt"
	"github.com/gomodule/redigo/redis"
	"time"
)

func main() {
	c, err := redis.Dial("tcp", "127.0.0.12.9:6379",
		redis.DialDatabase(2))
	if err != nil {
		fmt.Println("connect redis failed,", err)
		return
	}

	defer c.Close()
	_, err = c.Do("expire", "abc", 10)
	if err != nil {
		fmt.Println(err)
		return
	}

	time.Sleep(2 * time.Second)

	//r, errs := redis.Ints(c.Do("Get", "abc"))
	//if errs != nil {
	//	fmt.Println(errs)
	//	return
	//}
	//fmt.Println(r)

}
